//
//  CQWeiBo.h
//  Delicious
//
//  Created by yilong zhang on 11-11-25.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "QWeiboSyncApi.h"
#import "QVerifyWebViewController.h"

#define VERIFY_URL @"http://open.t.qq.com/cgi-bin/authorize?oauth_token="

#define QQ_AppKey      @"801069697"
#define QQ_AppSecret   @"89cac7a1796e2dac0023c64ba0c141ba"

#define qq_AppTokenKey		@"qq_tokenKey"
#define qq_AppTokenSecret	@"qq_tokenSecret"

@protocol QQWeiboDelegate;

@interface CQWeiBo : NSObject

@property (nonatomic, assign) id<QQWeiboDelegate>   m_QWeiboDelegate;

@property (nonatomic, retain) NSString  *m_strTokenKey;
@property (nonatomic, retain) NSString  *m_strTokenSecret;
@property (nonatomic, retain) NSString  *m_strUserName;

+(CQWeiBo*)DefaultQQwb;
+(void)DestroyQQwb;

-(void)loadDefaultKey;
-(void)saveDefaultKey;
-(NSString*)parseTokenKeyWithResponse:(NSString *)response IsSave:(BOOL)issave;
-(void)LoginQQWeibo:(UIViewController*)incontroller Name:(NSString*)name;
-(void)LogoutQQWeibo;
-(void)ShareToQWeibo:(NSString*)content ImageFile:(NSString*)filepath;
-(void)LoginQQWeiboSuc;
-(void)LoginCancel;

@end

@protocol QQWeiboDelegate <NSObject>

@optional
-(void)DidLoginQQWeibo:(CQWeiBo*)qweibo State:(int)state;

@end
